package cn.test.file;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

/**
 * @ClassName FileToArray
 * @Description TODO
 * @Author User
 * @Date 2020/12/14 11:39
 * @Version 1.0
 */
public class FileToArray {
    public static void main(String[] args) throws IOException {
        BufferedReader bufferedReader = new BufferedReader(new FileReader("file\\array.txt"));
        ArrayList<String> arrayList = new ArrayList<>();

        String line;
        while((line=bufferedReader.readLine())!=null){
            arrayList.add(line);
        }
        bufferedReader.close();

        //遍历集合
        for(String ss:arrayList){
            System.out.println(ss);
        }
    }
}
